Skip to content

Conversation

@IlyasRidhuan
Copy link
Contributor

@IlyasRidhuan IlyasRidhuan commented Jan 7, 2026

Introduces bytecode mutation using the standard LLVMFuzzerMutate. We allow the mutated bytecode to expand up to 2x the original size.

The mutation itself then utilises the contract upgrade path, this way we do not need to modify other classes or instances that may be used by other enqueued calls.

This does require the addition of public data writes as part of the setup to the fuzzer state (that also needs to happen in TS)

Copy link
Contributor Author

IlyasRidhuan commented Jan 7, 2026

@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-05-feat_avm_gas_mutations branch from 93eb5a8 to aa96990 Compare January 7, 2026 10:43
@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-06-feat_avm_avm_fuzzer_bytecode_mutation branch 2 times, most recently from 52b4d03 to fdd48ce Compare January 7, 2026 10:56
@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-05-feat_avm_gas_mutations branch 2 times, most recently from 3700f20 to 3d86939 Compare January 7, 2026 15:49
@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-06-feat_avm_avm_fuzzer_bytecode_mutation branch from fdd48ce to 1b2d92c Compare January 7, 2026 15:49
@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-05-feat_avm_gas_mutations branch from 3d86939 to d39d11f Compare January 8, 2026 12:48
@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-06-feat_avm_avm_fuzzer_bytecode_mutation branch from 1b2d92c to e6d52ef Compare January 8, 2026 12:48
@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-05-feat_avm_gas_mutations branch from d39d11f to 4168739 Compare January 8, 2026 13:04
@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-06-feat_avm_avm_fuzzer_bytecode_mutation branch from e6d52ef to 84fa05f Compare January 8, 2026 13:04
@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-05-feat_avm_gas_mutations branch from 4168739 to 6f984cd Compare January 8, 2026 13:11
@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-06-feat_avm_avm_fuzzer_bytecode_mutation branch from 84fa05f to 1a64875 Compare January 8, 2026 13:11
@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-05-feat_avm_gas_mutations branch from 6f984cd to fbabbed Compare January 8, 2026 15:49
@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-06-feat_avm_avm_fuzzer_bytecode_mutation branch 2 times, most recently from 5481b98 to dd4e396 Compare January 9, 2026 13:38
@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-05-feat_avm_gas_mutations branch from fbabbed to ac33049 Compare January 9, 2026 13:38
@IlyasRidhuan IlyasRidhuan changed the base branch from ir/01-05-feat_avm_gas_mutations to graphite-base/19378 January 9, 2026 14:38
@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-06-feat_avm_avm_fuzzer_bytecode_mutation branch from dd4e396 to d5a76af Compare January 9, 2026 14:52
@IlyasRidhuan IlyasRidhuan changed the base branch from graphite-base/19378 to ir/01-05-feat_avm_gas_mutations January 9, 2026 14:52
@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-06-feat_avm_avm_fuzzer_bytecode_mutation branch from d5a76af to a9f59ee Compare January 12, 2026 13:51
@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-05-feat_avm_gas_mutations branch from 3faa9e2 to 35ef4be Compare January 12, 2026 13:51
@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-06-feat_avm_avm_fuzzer_bytecode_mutation branch from a9f59ee to 5962f63 Compare January 12, 2026 14:36
@IlyasRidhuan IlyasRidhuan force-pushed the ir/01-05-feat_avm_gas_mutations branch from 35ef4be to a4be5dc Compare January 12, 2026 14:36
std::function<void(T&, std::mt19937_64&)> mutate_element_function,
std::function<T(std::mt19937_64&)> generate_random_element_function,
const std::function<void(T&, std::mt19937_64&)>& mutate_element_function,
const std::function<T(std::mt19937_64&)>& generate_random_element_function,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these were missing from an earlier pr

@IlyasRidhuan IlyasRidhuan marked this pull request as ready for review January 12, 2026 14:41
@AztecBot
Copy link
Collaborator

Flakey Tests

🤖 says: This CI run detected 2 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/d50a6f32d0546a42�d50a6f32d0546a428;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_l1_publisher/e2e_l1_publisher.test.ts (93s) (code: 1) (\033IlyasRidhuan\033: feat(avm): avm fuzzer bytecode mutation)
\033FLAKED\033 (8;;http://ci.aztec-labs.com/152aee5f696abf16�152aee5f696abf168;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_p2p/gossip_network.test.ts (440s) (code: 1) group:e2e-p2p-epoch-flakes (\033IlyasRidhuan\033: feat(avm): avm fuzzer bytecode mutation)

Copy link
Contributor

@sirasistant sirasistant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

}

// Apply public data tree writes (e.g., for contract instance upgrades)
if (!tx_data.public_data_writes.empty()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do just

for (const auto& write : tx_data.public_data_writes) {
    ws_mgr.public_data_write(write);
}

Base automatically changed from ir/01-05-feat_avm_gas_mutations to merge-train/avm January 13, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants